<template>
  <el-container>
    <el-header class="auto"><goback :content="content"></goback></el-header>
    <el-main>

      <el-tabs type="border-card" @tab-click="getTab" v-model="tab">
        <el-tab-pane label="押金申请" name="7">
          <cwYaJin></cwYaJin>
        </el-tab-pane>
        <el-tab-pane label="差旅申请" name="1">
          <cwClv></cwClv>
        </el-tab-pane>
       <el-tab-pane label="采买申请" name="2">
         <cwCmai></cwCmai>
       </el-tab-pane>
        <el-tab-pane label="借款申请" name="6">
          <cwJkuan></cwJkuan>
        </el-tab-pane>
        <el-tab-pane label="临款申请" name="8">
          <cwTemp></cwTemp>
        </el-tab-pane>
        <el-tab-pane label="付款申请" name="4">
          <cwFkuan></cwFkuan>
        </el-tab-pane>
        <el-tab-pane label="报销申请" name="3">
          <cwBaoXiao></cwBaoXiao>
        </el-tab-pane>
        <el-tab-pane label="发票申请" name="5">
          <cwTicket></cwTicket>
        </el-tab-pane>
      </el-tabs>

    </el-main>
  </el-container>
</template>

<script>
import goback from "../common/goback";
import cwClv from "./children/cwClv";
import cwCmai from "./children/cwCmai";
import cwBaoXiao from './children/cwBaoXiao'
import cwJkuan from './children/cwJkuan'
import cwYaJin from './children/cwYaJin'
import cwTemp from './children/cwTemp'
import cwFkuan from './children/cwFkuan'
import cwTicket from './children/cwTicket'
import {mapActions} from 'vuex'
export default {
  name: "financial",
  data(){
    return {
        content:"财务",
        tab: '7',
    }
  },
  components:{goback,cwClv,cwCmai,cwBaoXiao,cwJkuan,cwYaJin,cwTemp,cwFkuan,cwTicket},
    methods:{
      ...mapActions("FinanceData",['getApplyListActions','getTicketListActions']),

      ...mapActions("Setdata",['getAllRoleAndUserAction']),

        getTab(tab){
            const {_props:obj} = tab
            this.getApplyListActions({type: obj.name})
            if(obj.name == '5') this.getTicketListActions()

        }
    },

    mounted() {
      this.getAllRoleAndUserAction()
      this.getApplyListActions({type: 1})
    }
}
</script>

<style scoped>

</style>

